<template>
<a-table :columns="columns"
         :data-source="data"
         class="components-table-demo-nested">
<a slot="operation" slot-scope="text">操作</a>
<a-table
  slot="expandedRowRender"
  slot-scope="text"
  :columns="innerColumns"
  :data-source="innerData"
  :pagination="false"
  :rowKey="(record,index)=>{return index}">

  <span slot="operation" slot-scope="text" class="table-operation">
        <a-dropdown>
          <a-menu slot="overlay">
            <a-menu-item>
              操作 1
            </a-menu-item>
            <a-menu-item>
              操作 2
            </a-menu-item>
          </a-menu>
          <a> 更多 <a-icon type="down" /> </a>
        </a-dropdown>
      </span>
</a-table>
</a-table>
</template>
<script>
const columns = [
  { title: '课程号', dataIndex: 'id', key: 'id' },
  { title: '课程名', dataIndex: 'courseName', key: 'courseName' },
  { title: '课时', dataIndex: 'courseTime', key: 'courseTime' },
  { title: '操作', key: 'operation', scopedSlots: { customRender: 'operation' } },
];

const data = [];
// for (let i = 0; i < data.length; ++i) {
//   data.push({
//     key: i,
//     id: 1,
//     courseName: 2,
//     courseTime: 3,
//   });
// }

const innerColumns = [
  { title: '学号', dataIndex: 'studentNumber', key: 'studentNumber' },
  { title: '学生姓名', dataIndex: 'studentName', key: 'studentName' },
  {
    title: '操作',
    dataIndex: 'operation',
    key: 'operation',
    scopedSlots: { customRender: 'operation' },
  },
];

const innerData = [];
// for (let i = 0; i < innerData.length; ++i) {
//   innerData.push({
//     key: '',
//     studentNumber: innerData[i].studentNumber,
//     studentName: 'studentName',
//   });
// }
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'

export default {
  name:'StudentExperimentScore',
  data() {
    return {
      data,
      columns,
      innerColumns,
      innerData,
    };
  },
  created(){
  },
  methods: {
  },
  mounted() {
    postAction("/CourseListController/getSelectCourseList").then((res)=>{
      if (res.success){
        this.data = res.result.astuCourses;
        this.innerData = res.result.numberAndName;
        console.log(this.data);
        console.log(this.innerData);
      }
    })
  }
};
</script>



